package com.craftplay.dao;

import static org.apache.ibatis.jdbc.SqlBuilder.BEGIN;
import static org.apache.ibatis.jdbc.SqlBuilder.INSERT_INTO;
import static org.apache.ibatis.jdbc.SqlBuilder.SQL;
import static org.apache.ibatis.jdbc.SqlBuilder.VALUES;

import com.craftplay.model.BannerImage;

public class BannerImageSqlProvider {

    public String insertSelective(BannerImage record) {
        BEGIN();
        INSERT_INTO("banner_image");
        
        if (record.getId() != null) {
            VALUES("id", "#{id,jdbcType=INTEGER}");
        }
        
        if (record.getTitle() != null) {
            VALUES("title", "#{title,jdbcType=VARCHAR}");
        }
        
        if (record.getScope() != null) {
            VALUES("scope", "#{scope,jdbcType=VARCHAR}");
        }
        
        if (record.getJumpUrl() != null) {
            VALUES("jump_url", "#{jumpUrl,jdbcType=VARCHAR}");
        }
        
        if (record.getUrl() != null) {
            VALUES("url", "#{url,jdbcType=VARCHAR}");
        }
        
        return SQL();
    }
}